<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>JSONP 实例</title>
    <script src="https://cdn.static.runoob.com/libs/jquery/1.8.3/jquery.js"></script>    
</head>
<body>
<div id="divCustomers"></div>
<p id="demo"></p>
<script>
    $.getJSON("https://www.runoob.com/try/ajax/jsonp.php?jsoncallback=?", function(data) {
        
        var html = '<ul>';
        for(var i = 0; i < data.length; i++)
        {
            html += '<li>' + data[i] + '</li>';
        }
        html += '</ul>';
        
        $('#divCustomers').html(html); 
        console.log(data)
    });
    var obj = { "name":"runoob", "alexa":10000, "site":"www.runoob.com"};
    var myJSON = JSON.stringify(obj);
    document.getElementById("demo").innerHTML = myJSON;
</script>
</body>
</html>